<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6">
<head>
    <meta charset="UTF-8">
    <title>用户仪表盘</title>
    <style>
        .stats-card {
            border-radius: 0.75rem;
            transition: all 0.3s;
            border: none;
            height: 100%;
        }
        
        .stats-card:hover {
            transform: translateY(-5px);
        }
        
        .stats-icon {
            width: 64px;
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 1rem;
            font-size: 1.75rem;
        }
        
        .activity-item {
            padding: 1rem;
            border-radius: 0.5rem;
            background-color: #fff;
            margin-bottom: 1rem;
            border-left: 4px solid var(--primary-color);
            transition: all 0.3s;
        }
        
        .activity-item:hover {
            transform: translateX(5px);
            box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
        }
        
        .activity-time {
            font-size: 0.75rem;
            color: #6c757d;
        }
        
        .welcome-card {
            background: linear-gradient(135deg, var(--primary-color) 0%, #2e59d9 100%);
            color: white;
            border-radius: 1rem;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            position: relative;
            overflow: hidden;
        }
        
        .welcome-card::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            z-index: 0;
        }
        
        .quick-action {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1rem;
            border-radius: 0.5rem;
            background-color: #fff;
            box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
            transition: all 0.3s;
        }
        
        .quick-action:hover {
            transform: translateY(-5px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
        }
        
        .quick-action-icon {
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.5rem;
            margin-bottom: 0.5rem;
            font-size: 1.5rem;
        }
    </style>
</head>
<body>
    <div th:replace="~{layout :: body(content=~{::content})}">
        <div th:fragment="content">
            <!-- 页面标题 -->
            <div class="page-header mb-4">
                <h1>用户仪表盘</h1>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a th:href="@{/home}">首页</a></li>
                        <li class="breadcrumb-item active" aria-current="page">用户仪表盘</li>
                    </ol>
                </nav>
            </div>
            
            <!-- 欢迎卡片 -->
            <div class="welcome-card shadow-sm">
                <div class="row align-items-center">
                    <div class="col-md-9">
                        <h2 class="fw-bold mb-2">欢迎回来，<span sec:authentication="name"></span>！</h2>
                        <p class="mb-0">今天是 <span th:text="${#dates.format(#dates.createNow(), 'yyyy年MM月dd日')}">2025年04月29日</span> - 登录时间：<span th:text="${#dates.format(#dates.createNow(), 'HH:mm')}">09:30</span></p>
                    </div>
                    <div class="col-md-3 text-md-end mt-3 mt-md-0">
                        <a th:href="@{/user/profile}" class="btn btn-light">
                            <i class="bi bi-person me-2"></i>个人资料
                        </a>
                    </div>
                </div>
            </div>
            
            <!-- 统计卡片 -->
            <div class="row g-4 mb-5">
                <div class="col-md-4">
                    <div class="card stats-card shadow-sm">
                        <div class="card-body">
                            <div class="d-flex align-items-center justify-content-between mb-3">
                                <div class="stats-icon bg-primary bg-opacity-10 text-primary">
                                    <i class="bi bi-shield-check"></i>
                                </div>
                                <h5 class="fw-bold mb-0">基本信息</h5>
                            </div>
                            <h3 class="mb-1 fw-bold">已验证</h3>
                            <p class="mb-0 text-muted">账户状态正常</p>
                        </div>
                    </div>
                </div>
                
                <div class="col-md-4">
                    <div class="card stats-card shadow-sm">
                        <div class="card-body">
                            <div class="d-flex align-items-center justify-content-between mb-3">
                                <div class="stats-icon bg-success bg-opacity-10 text-success">
                                    <i class="bi bi-calendar-check"></i>
                                </div>
                                <h5 class="fw-bold mb-0">登录历史</h5>
                            </div>
                            <h3 class="mb-1 fw-bold">12次</h3>
                            <p class="mb-0 text-muted">近30天登录次数</p>
                        </div>
                    </div>
                </div>
                
                <div class="col-md-4">
                    <div class="card stats-card shadow-sm">
                        <div class="card-body">
                            <div class="d-flex align-items-center justify-content-between mb-3">
                                <div class="stats-icon bg-info bg-opacity-10 text-info">
                                    <i class="bi bi-key"></i>
                                </div>
                                <h5 class="fw-bold mb-0">安全等级</h5>
                            </div>
                            <h3 class="mb-1 fw-bold">良好</h3>
                            <p class="mb-0 text-muted">上次密码更新：30天前</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 快捷操作 -->
            <div class="card border-0 shadow-sm mb-5">
                <div class="card-header bg-white border-0 py-3">
                    <h5 class="mb-0"><i class="bi bi-lightning-charge text-warning me-2"></i>快捷操作</h5>
                </div>
                <div class="card-body">
                    <div class="row g-3">
                        <div class="col-md-3 col-6">
                            <a th:href="@{/user/profile}" class="text-decoration-none">
                                <div class="quick-action">
                                    <div class="quick-action-icon bg-primary bg-opacity-10 text-primary">
                                        <i class="bi bi-person"></i>
                                    </div>
                                    <span>修改资料</span>
                                </div>
                            </a>
                        </div>
                        <div class="col-md-3 col-6">
                            <a href="#" class="text-decoration-none">
                                <div class="quick-action">
                                    <div class="quick-action-icon bg-success bg-opacity-10 text-success">
                                        <i class="bi bi-shield-lock"></i>
                                    </div>
                                    <span>修改密码</span>
                                </div>
                            </a>
                        </div>
                        <div class="col-md-3 col-6">
                            <a href="#" class="text-decoration-none">
                                <div class="quick-action">
                                    <div class="quick-action-icon bg-info bg-opacity-10 text-info">
                                        <i class="bi bi-envelope"></i>
                                    </div>
                                    <span>消息通知</span>
                                </div>
                            </a>
                        </div>
                        <div class="col-md-3 col-6">
                            <a href="#" class="text-decoration-none">
                                <div class="quick-action">
                                    <div class="quick-action-icon bg-danger bg-opacity-10 text-danger">
                                        <i class="bi bi-question-circle"></i>
                                    </div>
                                    <span>帮助中心</span>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 最近活动 -->
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-white border-0 py-3">
                    <h5 class="mb-0"><i class="bi bi-activity text-danger me-2"></i>最近活动</h5>
                </div>
                <div class="card-body">
                    <div class="activity-item">
                        <div class="d-flex justify-content-between align-items-center">
                            <div>
                                <h6 class="mb-1">系统登录</h6>
                                <p class="mb-0 text-muted">您从Chrome浏览器登录了系统</p>
                            </div>
                            <div class="activity-time">
                                <span>刚刚</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="activity-item">
                        <div class="d-flex justify-content-between align-items-center">
                            <div>
                                <h6 class="mb-1">密码修改</h6>
                                <p class="mb-0 text-muted">您的账户密码已成功修改</p>
                            </div>
                            <div class="activity-time">
                                <span>30天前</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="activity-item">
                        <div class="d-flex justify-content-between align-items-center">
                            <div>
                                <h6 class="mb-1">账户创建</h6>
                                <p class="mb-0 text-muted">您的账户已创建并激活</p>
                            </div>
                            <div class="activity-time">
                                <span>60天前</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 